<?php
namespace xfyzf\api\controller;
class WXUOS_Protocol{
    public $api;
    public function __construct($url = ''){
        $this->api = empty($url)?"http://uosapi.daoh.top":$url;
    }
    public function wxlogin(){
        $api  = $this->api.'/api/GetLoginData';
        $res  = get_curl($api);
        return json_decode($res,true); 
    }
    public function wxCheckLoginQrcode($uuid){
        $api  = $this->api.'/api/CheckLoginState';
        $post = array(
            'uuid'=>$uuid
            );
        return get_curl($api,$post);
    }
    
    public function WXHeartBeat($cookie){
        $api  = $this->api.'/api/GetMessage';
        $post = array(
            'buid'=>$cookie
            );
        $json = json_decode(get_curl($api,$post),true);
        return $json;
        
    }
    public function Order($cookie){
        $api  = $this->api.'/api/GetMessage';
        $post = array(
            'buid'=>$cookie
            );
        $json = json_decode(get_curl($api,$post),true);
        if($json['code'] == '1'){
            return json_encode($json['data']['ret'],JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
        }
        return false;
        
    }
    
}


?>